﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%	dim rs,sql,i,name,id,fleg,gm,viphy,viphy2,nid,read,qingerr
	id=Request.QueryString("id")
	if id="" then id=0
	if not isnumeric(id) then id=0
	id=clng(id)




	Set Rs = Server.CreateObject("Adodb.Recordset")



	if sid<>"Null" then


	Sql = "select vip,id from qingtian_user where sid='"&md5(sid) & md5(strReverse(sid))&"'"
	Rs.Open Sql,conn,1,1

	if not (rs.bof and rs.eof)  then
		viphy=rs("vip")
		nid=rs("id")
	end if
	Rs.close	

	Sql = "select id from qingtian_paym where ext=0 and listid="&id&" and  nid="&nid&""
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
		gm=1
	else
		gm=0
	end if
	Rs.close	

	else
		viphy=0
		gm=0
	end if


		Sql = "select top 1 [vipgm],[viphy],[vip],[zf],[name],[fleg] from qingtian_class where fleg=0 and id="&id&""
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
			name=rs("name")
			fleg=rs("fleg")
			viphy2=rs("viphy")
		if viphy=1 then
				read=true
		elseif rs("viphy")=1 then
			read=false
		elseif rs("vip")=1 then
				if gm=1 or rs("zf")=0 then
					read=true
				else
					read=false
				end if
		else
			read=true

		end if

                else
                  qingerr=true
		end if
		Rs.close


		%><%

select case v
case "0"
we0="<br/>"
%>
<card title="<%=qingtian.utf8(name)%>"><p align="<%=qingtian.px%>">
<%
case "1"
hr="<hr>"
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title><%=qingtian.utf8(name)%></title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select
if qingerr=true then qingtian.err("该栏目还在建设中.....")

		if sid<>"Null" then
		qingtian.info
		end if

		if read=true  then


		Sql = "select [id],[vipgm],[name],[ext],[urls],[img],[br],[content] from qingtian_class where fleg="&id&" and yinz=0 order by [pid] asc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
		For i=1 to rs.RecordCount


			select case rs("ext")
			case 0
                                if rs("vipgm")=0 then
				%><a href="tian.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                else
					%><a href="/html/main<%=rs("id")%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                end if
				if rs("br")=1 then
					%><br/><%
				end if
			case 1
				%><%=qingtian.utf8(rs("name"))%><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 2
				%><a href="<%=qingtian.utf8(rs("urls"))%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 3
				if rs("content")="[end]" then
				qingtian.tuichu
				end if
				%>
<!--#include virtual="/inc/cssdate.inc"-->
<%=cp.ubbshow(qingtian.wml(content))%><%
				if rs("br")=1 then
					%><br/><%
				end if

			case 4
				if len(rs("urls"))>0 then
%>
                         <a href="<%=qingtian.utf8(rs("urls"))%>"><img src="<%=qingtian.utf8(rs("img"))%>" alt=''/></a>
<%
				else
				%><img src="<%=qingtian.utf8(rs("img"))%>" alt=''/><%
				end if
				if rs("br")=1 then
					%><br/><%
				end if
			case 5
				%><a href="view.asp?id=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 6
				%><a href="fileli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				end if
			case 7
                                if rs("vipgm")=0 then
				%><a href="viewli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                else
					%><a href="/html/main<%=rs("id")%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
                                end if
				if rs("br")=1 then
					%><br/><%
				end if
			case 8
				%><a href="photoli.asp?listid=<%=rs("id")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%
				if rs("br")=1 then
					%><br/><%
				else
					%>|<%
				end if
			end select
%>		
<%
Rs.MoveNext
		next
		end if
		Rs.close

		else
			if viphy2=1 then
				if viphy=1  then
				%><%=we%>该栏目需购买才能正常显示!<br/><a href="paym.asp?ext=0&amp;id=<%=id%>&amp;sid=<%=sidd%>">马上购买</a><%=we0%><%
				else
				%><%=we%>查看栏目出错!该栏目只允许VIP会员查看.请确认你为VIP会员!<%=we0%><%=dao%><a href="index.asp?sid=<%=sidd%>">网站首页</a><%
				end if
			else
				if sid<>"Null" then
				%><%=we%>该栏目需购买才能正常显示!<br/><a href="paym.asp?ext=0&amp;id=<%=id%>&amp;sid=<%=sidd%>">马上购买</a><%=we0%><%
				else
				%><%=we%>查看栏目出错!该栏目只允许会员查看.请先登陆再查看!<%=we0%>

<%
				end if
			end if
		end if
		

	if fleg>0 then
		Sql = "select top 1 [name],[ext],[vipgm] from qingtian_class where id="&fleg&""
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
			name=rs("name")
			select case rs("ext")
			case 0
                        if rs("vipgm")=0 then
			%><%=sou%>上级栏目&gt;<a href="tian.asp?id=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        else
			%><%=sou%>上级栏目&gt;<a href="/html/main<%=fleg%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        end if
			case 6
			%><%=sou%>上级栏目&gt;<a href="fileli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			case 7
                        if rs("vipgm")=0 then
			%><%=sou%>上级栏目&gt;<a href="viewli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        else
			%><%=sou%>上级栏目&gt;<a href="/html/main<%=fleg%>.asp?sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
                        end if
			case 8
			%><%=sou%>上级栏目&gt;<a href="photoli.asp?listid=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			case else
			%><%=sou%>上级栏目&gt;<a href="tian.asp?id=<%=fleg%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(name)%></a><%=we0%><%
			end select
		end if
		Rs.close

	end if
	set rs=nothing
end Function
%>
